<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!--
     whlie 结构：几乎和JAVA一致
     for 结构：几乎和JAVA一致
    -->
     <script>
        /* while  打印99乘法表*/
        var i = 1;
        while(i <= 9){
            var j = 1;
            while(j <= i){
                document.write(j+"*"+i+"="+i*j+"&nbsp;&nbsp;&nbsp;&nbsp;");
                j++;
            }
            document.write("<hr/>");
            i++;
        }
     </script>
     <br>
     <br>
     <br>
     <script>
        /* for */
        for(var i = 1 ;i<=9;i++){
            for(var j=1;j<=i;j++){
                document.write(j+"*"+i+"="+i*j+"&nbsp;&nbsp;&nbsp;&nbsp;");
            }
            document.write("<hr/>")
        }
     </script>
  
  <script>
    /* foreach循环(增强for循环)
          括号中的临时变量表示的是元素的索引，不是元素的值
          ()中也不再使用 ：（冒号)分割，而用关键词in
    */
     var cities =["北京","上海","南京","深圳","广东"]
     document.write("<ul>")
        for(var index in cities){
            document.write("<li>"+cities[index]+"</li>")
        }
        document.write("</ul>")
  </script>

</body>
</html>